-
Notifications
You must be signed in to change notification settings - Fork 794
[UR] Add a UR device info enum for checking native bfloat16 conversions #17372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi, @steffenlarsen and @kbenzie |
Signed-off-by: jinge90 <[email protected]>
Signed-off-by: jinge90 <[email protected]>
Signed-off-by: jinge90 <[email protected]>
| if ((Device->ZeDeviceProperties->deviceId & 0xfff) == 0x201 || | ||
| (Device->ZeDeviceProperties->deviceId & 0xff0) == 0xbd0) | ||
| return ReturnValue(true); | ||
| else | ||
| return ReturnValue(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if ((Device->ZeDeviceProperties->deviceId & 0xfff) == 0x201 || | |
| (Device->ZeDeviceProperties->deviceId & 0xff0) == 0xbd0) | |
| return ReturnValue(true); | |
| else | |
| return ReturnValue(false); | |
| return ReturnValue( | |
| (Device->ZeDeviceProperties->deviceId & 0xfff) == 0x201 || | |
| (Device->ZeDeviceProperties->deviceId & 0xff0) == 0xbd0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be in line with the changes here? https://github.com/intel/llvm/pull/17364/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Thanks for pointing out this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @steffenlarsen
Done.
Thanks very much.
unified-runtime/include/ur_api.h
Outdated
| /// point | ||
| UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS = 106, | ||
| /// [::ur_bool_t] support for native bfloat16 conversions | ||
| UR_DEVICE_INFO_BFLOAT16_CONVERSIONS_INTEL = 107, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this is added here and not as 122 after UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @steffenlarsen
At the beginning, I just used '122' but the pre-ci unified_runtime source check failed and asked to changed to '107', I don't know why the check asked so, just followed it.
Thanks very much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because the new etor is added part way through the yaml array.
| - name: BFLOAT16_CONVERSIONS_INTEL | ||
| desc: "[$x_bool_t] support for native bfloat16 conversions" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid rewriting all of the enum values, move this new entry to the end of the array, i.e. after line 451.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move this to the bottom and run the generate again please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @kbenzie
Fixed.
Thanks very much.
unified-runtime/include/ur_api.h
Outdated
| /// point | ||
| UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS = 106, | ||
| /// [::ur_bool_t] support for native bfloat16 conversions | ||
| UR_DEVICE_INFO_BFLOAT16_CONVERSIONS_INTEL = 107, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because the new etor is added part way through the yaml array.
Signed-off-by: jinge90 <[email protected]>
npmiller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CUDA/HIP changes LGTM
Signed-off-by: jinge90 <[email protected]>
Signed-off-by: jinge90 <[email protected]>
| TEST_P(urDeviceGetInfoTest, SuccessBFloat16) { | ||
| size_t property_size = 0; | ||
| const ur_device_info_t property_name = UR_DEVICE_INFO_BFLOAT16; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is for the old deprecated bfloat16 query, there's a pr open to remove it https://github.com/intel/llvm/pull/17053/files#diff-4ad6c68f3c3e27ec6c124dab1d1c2cd28dc6bba6f4e0960f44eec79b3c0c1c98
for testing if you could just copy this function but rename the test and update property_name that'd be ideal, like this:
TEST_P(urDeviceGetInfoTest, SuccessBFloat16Conversions) {
size_t property_size = 0;
const ur_device_info_t property_name = UR_DEVICE_INFO_BFLOAT16_CONVERSIONS_INTEL;
| desc: "[$x_bool_t] support the $xProgramSetSpecializationConstants entry point" | ||
| - name: USE_NATIVE_ASSERT | ||
| desc: "[$x_bool_t] return true if the device has a native assert implementation." | ||
| - name: BFLOAT16_CONVERSIONS_INTEL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove the _INTEL suffix here since we don't need to differentiate based on vendor for UR queries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @kbenzie
I changed the enum name to "UR_BFLOAT_CONVERSIONS_NATIVE".
Thanks very much.
Signed-off-by: jinge90 <[email protected]>
Signed-off-by: jinge90 <[email protected]>
| device, UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES, flags); | ||
| } | ||
|
|
||
| ur_result_t GetDeviceBFloat16ConversionsNativeSupport(ur_device_handle_t device, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this helper isn't used anywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @aarongreig
I removed the unused helper.
Thanks very much.
|
can you add a CTS test, it can be identical to this one
|
Hi, @aarongreig |
Signed-off-by: jinge90 <[email protected]>
|
Hi, @intel/llvm-gatekeepers |
No description provided.